package _13_Lianxi;

import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.PrintStream;

public class Merge {

	public static void main(String[] args) {
		try (FileReader fis1 = new FileReader("./src/_13_Lianxi/one.txt");
				FileReader fis2 = new FileReader("./src/_13_Lianxi/two.txt");
				FileReader fis3 = new FileReader("./src/_13_Lianxi/three.txt");
				) {
			PrintStream ps = System.out;
			System.setOut(new PrintStream(new FileOutputStream("./src/_13_Lianxi/merge.txt")));
			char[] chars = new char[102400];
			int tmp = 0;
			while ((tmp = fis1.read()) != -1) {
				// 存储数据
				System.out.print((char) tmp);
				
			}
			System.out.print("\n");
			while ((tmp = fis2.read()) != -1) {
				// 存储数据
				System.out.print((char) tmp);
				

			}
			System.out.print("\n");
			while ((tmp = fis3.read()) != -1) {
				// 存储数据
				System.out.print((char) tmp);
				

			}
			System.out.print("\n");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
